import {ajax} from "@/utils/ajax.js"
export {getRealResult} from "@/api/user.js"

export const initiate = ({realName,mobile,idCard,wxNum})=>{
	return ajax({
		url:'/authInfo/verifyPhoneUserBind',
		data:{
			realName,
			mobile,
			wxNum,
			idCard
		}
	})
}

export const createVirtualOrder = async ()=>{
	if(createVirtualOrder.lock){
		throw new Error('正在请求中')
	}
	try{
		createVirtualOrder.lock=true;
		const res = await ajax({
			url: '/order/createVirtualOrder',
			data: {
				productList:[{
					productId: '81400d7183687d7682e0773cce1a43e0', 
					productSkuId: 'f0762bfd6c285daf381b5d3c48a4ce98', 
					quantity: 1,
					remark:'' 
				}]
			}
		})
		return res;
	}finally{
		createVirtualOrder.lock = false;
	}
}